#include <stdio.h>
#define Num 8

typedef struct node{
    int adjvex;              //邻接点 
    struct node *nextarc;    //下一邻接点指针 
    //int nv, ne;              //数据域 
}ENode;

typedef struct vnode{         //表头结点
    char vexdata[10];         //顶点域
    struct node *firstarc;    //边的表头指针 
}VNode;

typedef struct{
    VNode adjlist[Num];  //邻接表
    int nv, ne;          //图中顶点数和边数 
}TGraph;

void BFS(TGraph *G, int *visited, int k); 

int main(int argc, char const *argv[]){
    TGraph Graph;
    G.nv = 8;
    G.ne = 8;
    int searched[8] = {0};
    //int i, j, k;
    ENode *s;
    for(i = 0; i < G->nv; i++)
        G.

    adjlist[i].firstarc = NULL; 
    
    for(i = 0; i < G->ne; i++){ 

        /*scanf("%d %d", &k, &j);fflush(stdin);
        s = (ENode *)malloc(sizeof(ENode));//边表结点
        s->adjvex = j;   //邻接点的序号为j
        s->nextarc = G->adjlist[k].firstarc;
        G->adjlist[k].firstarc = s;  //将新结点插入边表头 */
    }
    return 0;
}

void BFS(TGraph *Graph, int *visited, int k){
    int i;
    ENode *p;
    PQue que = init_que(G->nv);
    printf("%c", G->adjlist[i].vexdata);
    visited[k] = 1;
    enque(que, k);
    while(!is_empty(que)){  //依次搜索vi的邻接点
        i = deque(que);
        p = G->adjlist[i].firstarc;
        while(p){
            if(!visited[p->adjvex]){
                printf("%c", p->adjvex);  //访问vj
                visited[p->adjvex] = 1;
                enque(que, p->adjvex);
            }
            p = p->nextarc;         //找vi的下一个邻接点
        }
    }
}